﻿/*
-------------------------------------
    Rodeo Game Engine
    Copyright(c) Marcin Goryca
-------------------------------------
*/
#ifndef RODEO_IO_KEYBOARD_H_
#define RODEO_IO_KEYBOARD_H_

#ifndef RODEO_CORE_ERROR_H_
#include "core\error.h"
#endif

#ifndef RODEO_IO_INPUTINTERFACE_H_
#include "io\inputinterface.h"
#endif

namespace rodeoio
{
enum KeyMap
{
    KEY_UP = VK_UP,
    KEY_DOWN = VK_DOWN,
    KEY_LEFT = VK_LEFT,
    KEY_RIGHT = VK_RIGHT,

    KEY_0 = 48,
    KEY_1,
    KEY_2,
    KEY_3,
    KEY_4,
    KEY_5,
    KEY_6,
    KEY_7,
    KEY_8,
    KEY_9,

    KEY_A = 65,
    KEY_B,
    KEY_C,
    KEY_D,
    KEY_E,
    KEY_F,
    KEY_G,
    KEY_H,
    KEY_I,
    KEY_J,
    KEY_K,
    KEY_L,
    KEY_M,
    KEY_N,
    KEY_O,
    KEY_P,
    KEY_Q,
    KEY_R,
    KEY_S,
    KEY_T,
    KEY_U,
    KEY_V,
    KEY_W,
    KEY_X,
    KEY_Y,
    KEY_Z,

    KEY_NUM_0 = 96,
    KEY_NUM_1,
    KEY_NUM_2,
    KEY_NUM_3,
    KEY_NUM_4,
    KEY_NUM_5,
    KEY_NUM_6,
    KEY_NUM_7,
    KEY_NUM_8,
    KEY_NUM_9,

    KEY_F1 = VK_F1,
    KEY_F2 = VK_F2,
    KEY_F3 = VK_F3,
    KEY_F4 = VK_F4,
    KEY_F5 = VK_F5,
    KEY_F6 = VK_F6,
    KEY_F7 = VK_F7,
    KEY_F8 = VK_F8,
    KEY_F9 = VK_F9,
    KEY_F10 = VK_F10,
    KEY_F11 = VK_F11,
    KEY_F12 = VK_F12,

    KEY_ENTER = VK_RETURN,
    KEY_ESCAPE = VK_ESCAPE,
    KEY_TAB = VK_TAB,
    KEY_BACKSPACE = VK_BACK,
    KEY_SPACE = VK_SPACE,
    KEY_SHIFT = VK_SHIFT,
    KEY_ALT = VK_MENU,
    KEY_CTRL = VK_CONTROL,
    KEY_CAPS = VK_CAPITAL,
    KEY_PAGEUP = VK_PRIOR,
    KEY_PAGEDOWN = VK_NEXT,
    KEY_END = VK_END,
    KEY_HOME = VK_HOME,
    KEY_INSERT = VK_INSERT,
    KEY_DELETE = VK_DELETE,
    KEY_NUM_MINUS = VK_SUBTRACT,
    KEY_NUM_PLUS = VK_ADD,
    KEY_PLUS = VK_OEM_PLUS,
    KEY_MINUS = VK_OEM_MINUS,
};

class Keyboard : public InputInterface
{
public:
    Keyboard()
        :keystate_(-1)
    {}
    Keyboard(int state);
    Keyboard(const Keyboard& copy);
    Keyboard &operator= (const Keyboard& copy);

    virtual ~Keyboard(){}

    //virtual bool onInputEvent();

    //virtual void keyDown(KeyMap id);

    int getKeyState() const
    {
        return keystate_;
    }

    void setKeyState(int new_keystate)
    {
        keystate_ = new_keystate;
    }
//==== MEMBERS ====//
protected:
    int keystate_;

private:
};
}    //end of rodeoio namespace
#endif	//RODEO_IO_KEYBOARD_H_
